<%@page import="tx.bjdacp.model.*" %>
<%@ page contentType="text/html;charset=UTF-8" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib tagdir="/WEB-INF/tags/simpletable" prefix="simpletable"%>
<%@ include file="/commons/taglibs.jsp" %>

<rapid:override name="head">
	<title><%=DrugSellUnit.TABLE_ALIAS%> 维护</title>

	<link href="<c:url value="/widgets/simpletable/simpletable.css"/>" type="text/css" rel="stylesheet">
	<script type="text/javascript" src="<c:url value="/widgets/simpletable/simpletable.js"/>"></script>
<link rel="stylesheet" type="text/css" href="<c:url value="/widgets/jquery-easyui/themes/default/easyui.css"/>">
	<link rel="stylesheet" type="text/css" href="<c:url value="/widgets/jquery-easyui/themes/icon.css"/>">
	<script type="text/javascript" src="<c:url value="/widgets/jquery-easyui/jquery.easyui.min.js"/>"></script>

	<script type="text/javascript" >
		$(document).ready(function() {
			// 分页需要依赖的初始化动作
			window.simpleTable = new SimpleTable('queryForm',${page.thisPageNumber},${page.pageSize},'${pageRequest.sortColumns}');
		});
		function queryHistory(obj){
			getReferenceForm(obj).target='_blank';
			getReferenceForm(obj).action='${ctx}/pages/DrugSellUnitModifyLog/list.do';
			//getReferenceForm(obj).target='';
			//alert('aa');
		}
	</script>
</rapid:override>

<rapid:override name="content">
<s:bean name="tx.bjdacp.service.ZoneManager" var="zoneManager" ></s:bean>
<s:bean name="tx.bjdacp.service.DataDictManager" var="dataDictManager" ></s:bean>


	<form id="queryForm" name="queryForm" action="<c:url value="/pages/DrugSellUnit/list.do"/>" method="post" style="display: inline;">
<div class="easyui-panel" title="搜索" icon="icon-search" collapsible="true"  maximizable=true  style="background:#fafafa;">

	<div class="queryPanel">

			<table>
				<tr>

					<td class="tdLabel">所在镇<br/><%=DrugSellUnit.ALIAS_FILE_NUMBER%></td>
					<td>
					<s:select   list="#zoneManager.findAll()"
				                key="zoneId" theme="simple" headerKey=""  headerValue="请选择..." listValue="zoneName" listKey="zoneId"/><br/>
							<input value="${query.fileNumber}" id="fileNumber" name="fileNumber" maxlength="200"  class=""/>
					</td>
					<td class="tdLabel"><%=DrugSellUnit.ALIAS_UNIT_NAME%></td>
					<td>
						<input value="${query.unitName}" id="unitName" name="unitName" maxlength="200"  class=""/>
					</td>
					<td class="tdLabel"><%=DrugSellUnit.ALIAS_REGIST_ADDRESS%></td>
					<td>
						<input value="${query.registAddress}" id="registAddress" name="registAddress" maxlength="200"  class=""/>
					</td>
					<td class="tdLabel"><%=DrugSellUnit.ALIAS_IS_LOGOUT%></td>
					<td>
						<s:select headerKey=""  headerValue="请选择..." list="#dataDictManager.findAllByTypeBoolean()" key="isLogout"  theme="simple" listValue="ddName" listKey="ddName"/>
					</td>
				</tr>
				<tr>
					<td class="tdLabel"><%=DrugSellUnit.ALIAS_ARTIFICIAL_PERSON%></td>
					<td>
						<input value="${query.artificialPerson}" id="artificialPerson" name="artificialPerson" maxlength="200"  class=""/>
					</td>
					<td class="tdLabel"><%=DrugSellUnit.ALIAS_UNIT_PRINCIPAL%></td>
					<td>
						<input value="${query.unitPrincipal}" id="unitPrincipal" name="unitPrincipal" maxlength="200"  class=""/>
					</td>
					<td class="tdLabel"><%=DrugSellUnit.ALIAS_QUALITY_PRINCIPAL%></td>
					<td>
						<input value="${query.qualityPrincipal}" id="qualityPrincipal" name="qualityPrincipal" maxlength="200"  class=""/>
					</td>
					<td class="tdLabel"><%=DrugSellUnit.ALIAS_APOTHECARY%><br/><%=DrugSellUnit.ALIAS_APOTHECARY2%><br/><%=DrugSellUnit.ALIAS_APOTHECARY_CHINA%></td>
					<td>
						<input value="${query.apothecary}" id="apothecary" name="apothecary" maxlength="200"  class=""/><br/>
						<input value="${query.apothecary2}" id="apothecary2" name="apothecary2" maxlength="200"  class=""/><br/>
						<input value="${query.apothecaryChina}" id="apothecaryChina" name="apothecaryChina" maxlength="200"  class=""/>
					</td>
				</tr>
				<tr>
					<td class="tdLabel"><%=DrugSellUnit.ALIAS_SELL_MODE%></td>
					<td>
						<input value="${query.sellMode}" id="sellMode" name="sellMode" maxlength="200"  class=""/>
					</td>
					<td class="tdLabel"><%=DrugSellUnit.ALIAS_SELL_AREA%></td>
					<td>
						<input value="${query.sellArea}" id="sellArea" name="sellArea" maxlength="500"  class=""/>
					</td>
					<td class="tdLabel"><%=DrugSellUnit.ALIAS_STORAGE_ADDRESS%></td>
					<td>
						<input value="${query.storageAddress}" id="storageAddress" name="storageAddress" maxlength="200"  class=""/>
					</td>
					<td class="tdLabel"><%=DrugSellUnit.ALIAS_LICENCE_CODE%></td>
					<td>
						<input value="${query.licenceCode}" id="licenceCode" name="licenceCode" maxlength="200"  class=""/>
					</td>
				</tr>
				<tr>
					<td class="tdLabel"><%=DrugSellUnit.ALIAS_UNIT_FOUND_DATE%></td>
					<td>
						<input value="<fmt:formatDate value='${query.unitFoundDateBegin}' pattern='<%=DrugSellUnit.FORMAT_UNIT_FOUND_DATE%>'/>" onclick="WdatePicker({dateFmt:'<%=DrugSellUnit.FORMAT_UNIT_FOUND_DATE%>'})" id="unitFoundDateBegin" name="unitFoundDateBegin"   />
						<input value="<fmt:formatDate value='${query.unitFoundDateEnd}' pattern='<%=DrugSellUnit.FORMAT_UNIT_FOUND_DATE%>'/>" onclick="WdatePicker({dateFmt:'<%=DrugSellUnit.FORMAT_UNIT_FOUND_DATE%>'})" id="unitFoundDateEnd" name="unitFoundDateEnd"   />
					</td>
					<td class="tdLabel"><%=DrugSellUnit.ALIAS_LICENCE_GIVE_DATE%></td>
					<td>
						<input value="<fmt:formatDate value='${query.licenceGiveDateBegin}' pattern='<%=DrugSellUnit.FORMAT_LICENCE_GIVE_DATE%>'/>" onclick="WdatePicker({dateFmt:'<%=DrugSellUnit.FORMAT_LICENCE_GIVE_DATE%>'})" id="licenceGiveDateBegin" name="licenceGiveDateBegin"   />
						<input value="<fmt:formatDate value='${query.licenceGiveDateEnd}' pattern='<%=DrugSellUnit.FORMAT_LICENCE_GIVE_DATE%>'/>" onclick="WdatePicker({dateFmt:'<%=DrugSellUnit.FORMAT_LICENCE_GIVE_DATE%>'})" id="licenceGiveDateEnd" name="licenceGiveDateEnd"   />
					</td>
					<td class="tdLabel"><%=DrugSellUnit.ALIAS_LICENCE_EXPIRY_DATE%></td>
					<td>
						<input value="<fmt:formatDate value='${query.licenceExpiryDateBegin}' pattern='<%=DrugSellUnit.FORMAT_LICENCE_EXPIRY_DATE%>'/>" onclick="WdatePicker({dateFmt:'<%=DrugSellUnit.FORMAT_LICENCE_EXPIRY_DATE%>'})" id="licenceExpiryDateBegin" name="licenceExpiryDateBegin"   />
						<input value="<fmt:formatDate value='${query.licenceExpiryDateEnd}' pattern='<%=DrugSellUnit.FORMAT_LICENCE_EXPIRY_DATE%>'/>" onclick="WdatePicker({dateFmt:'<%=DrugSellUnit.FORMAT_LICENCE_EXPIRY_DATE%>'})" id="licenceExpiryDateEnd" name="licenceExpiryDateEnd"   />
					</td>
					<td class="tdLabel"><%=DrugSellUnit.ALIAS_GSP_CODE%></td>
					<td>
						<input value="${query.gspCode}" id="gspCode" name="gspCode" maxlength="200"  class=""/>
					</td>
				</tr>
				<tr>
					<td class="tdLabel"><%=DrugSellUnit.ALIAS_GSP_GIVE_DATE%></td>
					<td>
						<input value="<fmt:formatDate value='${query.gspGiveDateBegin}' pattern='<%=DrugSellUnit.FORMAT_GSP_GIVE_DATE%>'/>" onclick="WdatePicker({dateFmt:'<%=DrugSellUnit.FORMAT_GSP_GIVE_DATE%>'})" id="gspGiveDateBegin" name="gspGiveDateBegin"   />
						<input value="<fmt:formatDate value='${query.gspGiveDateEnd}' pattern='<%=DrugSellUnit.FORMAT_GSP_GIVE_DATE%>'/>" onclick="WdatePicker({dateFmt:'<%=DrugSellUnit.FORMAT_GSP_GIVE_DATE%>'})" id="gspGiveDateEnd" name="gspGiveDateEnd"   />
					</td>
					<td class="tdLabel"><%=DrugSellUnit.ALIAS_GSP_EXPIRY_DATE%></td>
					<td>
						<input value="<fmt:formatDate value='${query.gspExpiryDateBegin}' pattern='<%=DrugSellUnit.FORMAT_GSP_EXPIRY_DATE%>'/>" onclick="WdatePicker({dateFmt:'<%=DrugSellUnit.FORMAT_GSP_EXPIRY_DATE%>'})" id="gspExpiryDateBegin" name="gspExpiryDateBegin"   />
						<input value="<fmt:formatDate value='${query.gspExpiryDateEnd}' pattern='<%=DrugSellUnit.FORMAT_GSP_EXPIRY_DATE%>'/>" onclick="WdatePicker({dateFmt:'<%=DrugSellUnit.FORMAT_GSP_EXPIRY_DATE%>'})" id="gspExpiryDateEnd" name="gspExpiryDateEnd"   />
					</td>

					<td class="tdLabel"><%=DrugSellUnit.ALIAS_IS_RESEND_LICENSE%></td>
					<td>
														<s:select headerKey=""  headerValue="请选择..." list="#dataDictManager.findAllByTypeBoolean()" key="isResendLicense"  theme="simple" listValue="ddName" listKey="ddValue"/>

					</td>
					<td class="tdLabel"><%=DrugSellUnit.ALIAS_IS_OTCUNIT%></td>
					<td>
									<s:select headerKey=""  headerValue="请选择..."   list="#dataDictManager.findAllByTypeBoolean()" key="isOtcunit"  theme="simple" listValue="ddName" listKey="ddValue"/>

					</td>
				</tr>
				<tr>
					<td class="tdLabel"><%=DrugSellUnit.ALIAS_MOBEL_PHONE%></td>
					<td>
						<input value="${query.mobelPhone}" id="mobelPhone" name="mobelPhone" maxlength="200"  class=""/>
					</td>
					<td class="tdLabel"><%=DrugSellUnit.ALIAS_PHONE%></td>
					<td>
						<input value="${query.phone}" id="phone" name="phone" maxlength="200"  class=""/>
					</td>
					<td class="tdLabel"><%=DrugSellUnit.ALIAS_IS_TOUR_DRUGSTORE%></td>
					<td>
					<s:select headerKey=""  headerValue="请选择..." list="#dataDictManager.findAllByTypeBoolean()" key="isTourDrugstore"  theme="simple" listValue="ddName" listKey="ddValue"/>
					</td>
					<td class="tdLabel"><%=DrugSellUnit.ALIAS_IS_SELL_CHINESE_MEDICINE%><br/><br/><%=DrugSellUnit.ALIAS_IS_STOP%></td>
					<td>
				<s:select headerKey=""  headerValue="请选择..." list="#dataDictManager.findAllByTypeBoolean()" key="isSellChineseMedicine"  theme="simple" listValue="ddName" listKey="ddValue"/>
				<br/><s:select headerKey=""  headerValue="请选择..." list="#dataDictManager.findAllByTypeBoolean()" key="isStop"  theme="simple" listValue="ddName" listKey="ddValue"/>
					</td>

				</tr>

			</table>
		<div class="handleControl">
			<input type="submit" class="stdButton" style="width:80px" value="查询" onclick="getReferenceForm(this).action='${ctx}/pages/DrugSellUnit/list.do'"/>
			<input type="submit" class="stdButton" style="width:80px" value="新增" onclick="getReferenceForm(this).action='${ctx}/pages/DrugSellUnit/create.do'"/>
			<input type="button" class="stdButton" style="width:80px" value="删除" onclick="batchDelete('${ctx}/pages/DrugSellUnit/delete.do','items',document.forms.queryForm)"/>
	    	<input type="submit" class="stdButton" style="width:80px" value="导出Excel" onclick="getReferenceForm(this).action='${ctx}/pages/DrugSellUnit/listExcel.do'"/>
	    	<input type="submit" class="stdButton" style="width:160px" value="人员兼职查询（法人输入框）" onclick="getReferenceForm(this).action='${ctx}/pages/DrugSellUnit/partTimeJobList.do'"/>
	    	<input type="submit" class="stdButton" style="width:80px" value="变更记录查询" onclick="queryHistory(this)"/>

	    </div>
	</div>
</div>
	<div class="gridTable">

		<simpletable:pageToolbar page="${page}">
		</simpletable:pageToolbar>

		<table width="100%"  border="0" cellspacing="0" class="gridBody">
		  <thead>

			  <tr>
				<th style="width:1px;">&nbsp; </th>
				<th style="width:1px;"><input type="checkbox" onclick="setAllCheckboxState('items',this.checked)"></th>

				<!-- 排序时为th增加sortColumn即可,new SimpleTable('sortColumns')会为tableHeader自动增加排序功能; -->
				<th sortColumn="file_number" ><%=DrugSellUnit.ALIAS_FILE_NUMBER%></th>
				<th sortColumn="zone_id" >所在镇</th>
				<th sortColumn="unit_name" ><%=DrugSellUnit.ALIAS_UNIT_NAME%></th>
				<th sortColumn="regist_address" ><%=DrugSellUnit.ALIAS_REGIST_ADDRESS%></th>
				<th sortColumn="artificial_person" ><%=DrugSellUnit.ALIAS_ARTIFICIAL_PERSON%></th>
				<th sortColumn="unit_principal" ><%=DrugSellUnit.ALIAS_UNIT_PRINCIPAL%></th>
				<th sortColumn="quality_principal" ><%=DrugSellUnit.ALIAS_QUALITY_PRINCIPAL%></th>
				<th sortColumn="apothecary" ><%=DrugSellUnit.ALIAS_APOTHECARY%></th>
				<th sortColumn="apothecary2" ><%=DrugSellUnit.ALIAS_APOTHECARY2%></th>
				<th sortColumn="apothecaryChina" ><%=DrugSellUnit.ALIAS_APOTHECARY_CHINA%></th>
				<th sortColumn="sell_mode" ><%=DrugSellUnit.ALIAS_SELL_MODE%></th>
				<th sortColumn="sell_area" ><%=DrugSellUnit.ALIAS_SELL_AREA%></th>
				<th sortColumn="storage_address" ><%=DrugSellUnit.ALIAS_STORAGE_ADDRESS%></th>
				<th sortColumn="licence_code" ><%=DrugSellUnit.ALIAS_LICENCE_CODE%></th>
				<th sortColumn="unit_found_date" ><%=DrugSellUnit.ALIAS_UNIT_FOUND_DATE%></th>
				<th sortColumn="licence_give_date" ><%=DrugSellUnit.ALIAS_LICENCE_GIVE_DATE%></th>
				<th sortColumn="licence_expiry_date" ><%=DrugSellUnit.ALIAS_LICENCE_EXPIRY_DATE%></th>
				<th sortColumn="gsp_code" ><%=DrugSellUnit.ALIAS_GSP_CODE%></th>
				<th sortColumn="gsp_give_date" ><%=DrugSellUnit.ALIAS_GSP_GIVE_DATE%></th>
				<th sortColumn="gsp_expiry_date" ><%=DrugSellUnit.ALIAS_GSP_EXPIRY_DATE%></th>
				<th sortColumn="mobel_phone" ><%=DrugSellUnit.ALIAS_MOBEL_PHONE%></th>
				<th sortColumn="phone" ><%=DrugSellUnit.ALIAS_PHONE%></th>

				<th>操作</th>
			  </tr>

		  </thead>
		  <tbody>
		  	  <c:forEach items="${page.result}" var="item" varStatus="status">

			  <tr class="${status.count % 2 == 0 ? 'odd' : 'even'}">
				<td>${page.thisPageFirstElementNumber + status.index}</td>
				<td><input type="checkbox" name="items" value="drugSellUnitId=${item.drugSellUnitId}&"></td>
				<td><c:out value='${item.fileNumber}'/>&nbsp;</td>
				<td><c:out value='${item.zone.zoneName}'/>&nbsp;</td>
				<td><c:out value='${item.unitName}'/>&nbsp;</td>
				<td><c:out value='${item.registAddress}'/>&nbsp;</td>
				<td><c:out value='${item.artificialPerson}'/>&nbsp;</td>
				<td><c:out value='${item.unitPrincipal}'/>&nbsp;</td>
				<td><c:out value='${item.qualityPrincipal}'/>&nbsp;</td>
				<td><c:out value='${item.apothecary}'/>&nbsp;</td>
				<td><c:out value='${item.apothecary2}'/>&nbsp;</td>
				<td><c:out value='${item.apothecaryChina}'/>&nbsp;</td>
				<td><c:out value='${item.sellMode}'/>&nbsp;</td>
				<td><c:out value='${item.sellArea}'/>&nbsp;</td>
				<td><c:out value='${item.storageAddress}'/>&nbsp;</td>
				<td><c:out value='${item.licenceCode}'/>&nbsp;</td>
				<td><c:out value='${item.unitFoundDateString}'/>&nbsp;</td>
				<td><c:out value='${item.licenceGiveDateString}'/>&nbsp;</td>
				<td><c:out value='${item.licenceExpiryDateString}'/>&nbsp;</td>
				<td><c:out value='${item.gspCode}'/>&nbsp;</td>
				<td><c:out value='${item.gspGiveDateString}'/>&nbsp;</td>
				<td><c:out value='${item.gspExpiryDateString}'/>&nbsp;</td>
				<td><c:out value='${item.mobelPhone}'/>&nbsp;</td>
				<td><c:out value='${item.phone}'/>&nbsp;</td>

				<td>
					<a href="${ctx}/pages/DrugSellUnit/show.do?drugSellUnitId=${item.drugSellUnitId}&">查看</a>&nbsp;&nbsp;&nbsp;
					<a href="${ctx}/pages/DrugSellUnit/edit.do?drugSellUnitId=${item.drugSellUnitId}&">修改</a>
					<a href="${ctx}/pages/FileCatalog/createList.do?drugSellUnitId=${item.drugSellUnitId}&"  target="_blank">添加档案</a>
				</td>
			  </tr>

		  	  </c:forEach>
		  </tbody>
		</table>

		<simpletable:pageToolbar page="${page}">
		</simpletable:pageToolbar>
	</div>
	</form>
</rapid:override>

<%-- jsp模板继承,具体使用请查看: http://code.google.com/p/rapid-framework/wiki/rapid_jsp_extends --%>
<%@ include file="base.jsp" %>

